#coding=utf-8 
import yaml
import sys
# 获取单个play文件的去重标签内容
def get_tags(yaml_path):

    tags = []
    with open(yaml_path) as file:
        plays = yaml.load(file,Loader=yaml.Loader)
        if len(plays) <= 0:
            return tags
        for play in plays:
            child_tags = play['tags']
            if len(child_tags) <= 0:
                continue
            for item in child_tags:
                if item in tags:
                    continue
                tags.append(item)
    return tags

total_tags=[]
for i in range(len(sys.argv)):
    if i == 0:
        continue
    play_tags = get_tags(sys.argv[i])
    if len(play_tags) <=0 :
        continue
    total_tags.extend(play_tags)

print(' '.join(total_tags))
